/**
 * Created by dukes on 2015/11/4.
 */
class GetoutScene extends eui.Component{
    public constructor(){
        super();
        this.skinName = "skins.scene.GetoutSceneSkin";
        this.y = 63;
        // this.addEventListener(egret.Event.ADDED_TO_STAGE,this.addedToStage, this );
        // this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.removedFromStage, this);
    }
    // private onSelectedTab(evt:eui.IndexChangeEvent){
    //     SoundMgr.getInstance().playEffect(SoundMgr.BTN);
    //     if( evt.newIndex == 0 || evt.newIndex == 1){
    //         this.panel_group.removeAllElements();
    //         this.panel_group.addChild(DateScene.getInstance());
    //         if( evt.newIndex == 0){
    //             if(!evt.data)
    //                 DateScene.getInstance().updateType(0);
    //             else
    //                 DateScene.getInstance().updateType(0,true);
    //         }else if( evt.newIndex == 1){
    //             if(!evt.data)
    //                 DateScene.getInstance().updateType(1);
    //             else
    //                 DateScene.getInstance().updateType(1,true);
    //         }
    //     }else  if( evt.newIndex == 2){
    //         this.panel_group.removeAllElements();
    //         this.panel_group.addChild(ContributionPanel.getInstance());
    //     }else if( evt.newIndex == 3){
    //         this.panel_group.removeAllElements();
    //         this.panel_group.addChild(BattleRecordPanel.getInstance());
    //     }
    //    this.updateLabels();
    // }

    // public updateLabels(){
    //     var selectedIndex = this.fuck_tab.selectedIndex;
    //     this.fuck_follow.visible = selectedIndex != 0;
    //     this.fuck_follow_1.visible = selectedIndex == 0;
    //     this.fuck_strangers.visible = selectedIndex != 1;
    //     this.fuck_strangers_1.visible = selectedIndex == 1;
    //     this.fuck_contribute.visible = selectedIndex != 2;
    //     this.fuck_contribute_1.visible = selectedIndex == 2;
    //     this.fuck_record.visible = selectedIndex != 3;
    //     this.fuck_record_1.visible = selectedIndex == 3;
    // }

    // private addedToStage(evt:egret.Event){
    //     this.fuck_tab.addEventListener(eui.IndexChangeEvent.CHANGE, this.onSelectedTab, this);
    //     if( (this.fuck_tab.selectedIndex == 0 || this.fuck_tab.selectedIndex == 1) && DateScene.getInstance().curVisitId && DateScene.getInstance().curVisitId != -1){
    //         window["__visit"](DateScene.getInstance().curVisitId);
    //     }
    // }
    // private removedFromStage(evt:egret.Event){
    //     this.fuck_tab.removeEventListener(eui.IndexChangeEvent.CHANGE, this.onSelectedTab, this);
    // }
    // public partAdded(name:string, instance:any) {
    //     super.partAdded(name, instance);
    //     if (name == "fuck_tab") {
    //         this.fuck_tab = instance;
    //         this.fuck_tab.itemRenderer = new eui.ClassFactory(GetoutTab);
    //         this.fuck_tab.dataProvider = new eui.ArrayCollection([0, 1, 2, 3]);
    //     } else if (name == "fuck_follow") {
    //         this.fuck_follow = instance;
    //     } else if (name == "fuck_follow_1") {
    //         this.fuck_follow_1 = instance;
    //     } else if (name == "fuck_strangers") {
    //         this.fuck_strangers = instance;
    //     } else if (name == "fuck_strangers_1") {
    //         this.fuck_strangers_1 = instance;
    //     }else if (name == "panel_group") {
    //         this.panel_group = instance;
    //     }else if (name == "fuck_record") {
    //         this.fuck_record = instance;
    //     }else if (name == "fuck_record_1") {
    //         this.fuck_record_1 = instance;
    //     }
    // }
    // public panel_group:eui.Group;
    // public fuck_tab:eui.TabBar;
    // public fuck_follow:eui.Image;
    // public fuck_follow_1:eui.Image;
    // public fuck_strangers:eui.Image;
    // public fuck_strangers_1:eui.Image;
    // public fuck_contribute:eui.Image;
    // public fuck_contribute_1:eui.Image;
    // public fuck_record:eui.Image;
    // public fuck_record_1:eui.Image;
    // public childrenCreated(){
    //     super.childrenCreated();
    //     this.panel_group.addChild(DateScene.getInstance());
    //     this.fuck_tab.selectedIndex = 0;
    // }
    private static _instance:GetoutScene;
    public static getInstance():GetoutScene{
        if( GetoutScene._instance == null )
            GetoutScene._instance = new GetoutScene();
        return GetoutScene._instance;
    }
}